/**
 * @file
 * @description 公共组件注册文件
 */

import { Loading, Upload, Button, Select, Option, Table, Breadcrumb, Switch, TabPane, Tabs, Cascader, Alert, Dialog, Form, FormItem, Pagination, MessageBox, Tag, TableColumn, BreadcrumbItem, Tree, Input, Menu, MenuItem, MenuItemGroup, Submenu, Result, Message } from "element-ui"
import { confirm } from "./common";
import { myConfirm } from "com/MyConfirm/index.js";

// 注册组件
import MyDialog from "com/Dialog";
import MyTable from "com/Table";
import MySearch from "com/Search"
import MyForm from "com/Form"
import MyDialogForm from "com/DialogForm"

export default {
    install(Vue) {
        Vue.prototype.$myconfirm = myConfirm;
        Vue.prototype.$m = Message;
        Vue.prototype.$mb = MessageBox;
        Vue.prototype.$confirm = confirm;
        // 注册组件
        [MyDialog,MyTable, MySearch, MyForm, MyDialogForm].forEach(item => Vue.component(item.name, item));

        [Loading, Upload, Button, Table, Select, Option, Breadcrumb, Switch, Alert, Cascader, TabPane, Tabs, Pagination, Dialog, Form, FormItem, BreadcrumbItem, Tag, TableColumn, Tree, Input, Menu, MenuItem, MenuItemGroup, Submenu, Result].forEach(item => Vue.use(item))
    }
}